<?php
Util::tsRegisterAssetCss('historial/plugin/daterangepicker.css');
Util::tsRegisterAssetJs('historial/plugin/moment.min.js');
Util::tsRegisterAssetJs('historial/plugin/daterangepicker.js');
Util::tsRegisterAssetJs('historial/historial.js');

/** @var ReclamoController $this */
/** @var Reclamo $model */
$this->breadcrumbs = array(
    'Reclamos' => array('index'),
    Yii::t('AweCrud.app', 'Historial'),
);
?>
<br>
<div class="main-box clearfix">
    <header class="main-box-header clearfix">
        <h2 class="pull-left"><?php echo Yii::t('AweCrud.app', 'Historial') ?> <?php echo Reclamo::label(2) . ' ' ?> </h2>
    </header>
    <div class="main-box-body clearfix">
        <div class="row">
            <div class="col-md-3">
                <div class="input-group">
                    <span class="input-group-addon"><i class="fa fa-calendar-o"></i></span>
                    <input type="text" class="form-control" id="datepickerDateRange">
                </div>
            </div>
            <div class="col-md-3">
                <select id="ddl_estado" class="form-control" >
                    <option value>- ESTADO (TODOS) -</option>
                    <?php
                    foreach (Reclamo_Constants::$estados as $estado) {
                        echo '<option value="' . $estado['value'] . '">' . $estado['value'] . '</option>';
                    }
                    ?>
                </select>
            </div>
            <div class="col-md-3">
                <select id="ddl_calificacion" class="form-control" >
                    <option value>- CALIFICACIÓN (TODAS) -</option>
                    <?php
                    foreach (Reclamo_Constants::$calificaciones as $calificacion) {
                        echo '<option value="' . $calificacion['value'] . '">' . $calificacion['value'] . '</option>';
                    }
                    ?>
                </select>
            </div>

        </div>
        <?php
        $this->widget('booster.widgets.TbGridView', array(
            'id' => 'reclamo-grid',
            'type' => 'striped table-responsive condensed',
            'dataProvider' => $dataProvider,
            'columns' => array(
                'asunto',
                array(
                    'name' => 'id_usuario_estudiante',
                    'value' => '$data->nombreEstudiante',
                    'type' => 'raw'
                ),
                'fecha_creacion',
                array(
                    'name' => 'estado',
                    'type' => 'raw',
                    'value' => '$data->estadoLabel'
                ),
                'fecha_resolucion',
                array(
                    'name' => 'calificacion',
                    'type' => 'raw',
                    'value' => '$data->calificacionLabel'
                ),
                'fecha_calificacion',
                array('class' => 'booster.widgets.TbButtonColumn',
                    'template' => '{view}',
                    'buttons' => array(
                        'view' => array(
                            'label' => 'Ver',
                            'icon' => 'fa fa-search',
                            'url' => '"reclamos/reclamo/view/id/".$data->id',
                            'imageUrl' => false,
                            'click' => 'js:function(){viewModal($(this).attr("href"),function(){});return false;}',
                            'visible' => 'Util::checkAccess(array("action_reclamo_view"))'
                        ),
                    ),
                ),
            ),
        ));
        ?>
    </div>
</div>
